<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>苟有恒 何必三更起五更眠 最无益 莫过一日曝十日寒</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:type" content="website">
<meta property="og:title" content="苟有恒 何必三更起五更眠 最无益 莫过一日曝十日寒">
<meta property="og:url" content="http://dontworryneedmoney.gitee.io/guolianbo/index.html">
<meta property="og:site_name" content="苟有恒 何必三更起五更眠 最无益 莫过一日曝十日寒">
<meta property="og:locale" content="en_US">
<meta property="article:author" content="worry dont">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/guolianbo/atom.xml" title="苟有恒 何必三更起五更眠 最无益 莫过一日曝十日寒" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/guolianbo/css/style.css">

<meta name="generator" content="Hexo 4.2.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/guolianbo/" id="logo">苟有恒 何必三更起五更眠 最无益 莫过一日曝十日寒</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/guolianbo/">Home</a>
        
          <a class="main-nav-link" href="/guolianbo/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/guolianbo/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://dontworryneedmoney.gitee.io/guolianbo"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="ejs-dontworry/Unity3d/IObserver和IObservable和IDisposable" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/06/08/dontworry/Unity3d/IObserver%E5%92%8CIObservable%E5%92%8CIDisposable/" class="article-date">
  <time datetime="2020-06-08T12:45:34.313Z" itemprop="datePublished">2020-06-08</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/06/08/dontworry/Unity3d/IObserver%E5%92%8CIObservable%E5%92%8CIDisposable/">IObserver和IObservable和IDisposable</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="定义"><a href="#定义" class="headerlink" title="定义"></a>定义</h2><ul>
<li><code>IObserver</code>观察者接口（订阅者），<code>IObservable</code>可被观察者接口（发布者）</li>
<li><code>IDisposable</code>释放非托管资源接口 </li>
</ul>
<h2 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h2><figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">using</span> System;</span><br><span class="line"><span class="keyword">using</span> System.Collections.Generic;</span><br><span class="line"></span><br><span class="line"><span class="keyword">class</span> <span class="title">Program</span></span><br><span class="line">&#123;</span><br><span class="line">    <span class="function"><span class="keyword">static</span> <span class="keyword">void</span> <span class="title">Main</span>(<span class="params"><span class="keyword">string</span>[] args</span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        <span class="comment">// Define a provider and two observers.</span></span><br><span class="line">        LocationTracker provider = <span class="keyword">new</span> LocationTracker();</span><br><span class="line">        LocationReporter reporter1 = <span class="keyword">new</span> LocationReporter(<span class="string">"FixedGPS"</span>);</span><br><span class="line">        reporter1.Subscribe(provider);</span><br><span class="line">        LocationReporter reporter2 = <span class="keyword">new</span> LocationReporter(<span class="string">"MobileGPS"</span>);</span><br><span class="line">        reporter2.Subscribe(provider);</span><br><span class="line"></span><br><span class="line">        provider.TrackLocation(<span class="keyword">new</span> Location(<span class="number">47.6456</span>, <span class="number">-122.1312</span>));</span><br><span class="line">        reporter1.Unsubscribe();</span><br><span class="line">        provider.TrackLocation(<span class="keyword">new</span> Location(<span class="number">47.6677</span>, <span class="number">-122.1199</span>));</span><br><span class="line">        provider.TrackLocation(<span class="literal">null</span>);</span><br><span class="line">        provider.EndTransmission();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">// The example displays output similar to the following:</span></span><br><span class="line"><span class="comment">//      FixedGPS: The current location is 47.6456, -122.1312</span></span><br><span class="line"><span class="comment">//      MobileGPS: The current location is 47.6456, -122.1312</span></span><br><span class="line"><span class="comment">//      MobileGPS: The current location is 47.6677, -122.1199</span></span><br><span class="line"><span class="comment">//      MobileGPS: The location cannot be determined.</span></span><br><span class="line"><span class="comment">//      The Location Tracker has completed transmitting data to MobileGPS.</span></span><br><span class="line"></span><br><span class="line">public class LocationTracker : IObservable&lt;Location&gt;</span><br><span class="line">&#123;</span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="title">LocationTracker</span>(<span class="params"></span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        observers = <span class="keyword">new</span> List&lt;IObserver&lt;Location&gt;&gt;();</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> List&lt;IObserver&lt;Location&gt;&gt; observers;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> IDisposable <span class="title">Subscribe</span>(<span class="params">IObserver&lt;Location&gt; observer</span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        <span class="keyword">if</span> (! observers.Contains(observer))</span><br><span class="line">            observers.Add(observer);</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">new</span> Unsubscriber(observers, observer);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">class</span> <span class="title">Unsubscriber</span> : <span class="title">IDisposable</span></span><br><span class="line">    &#123;</span><br><span class="line">        <span class="keyword">private</span> List&lt;IObserver&lt;Location&gt;&gt;_observers;</span><br><span class="line">        <span class="keyword">private</span> IObserver&lt;Location&gt; _observer;</span><br><span class="line"></span><br><span class="line">        <span class="function"><span class="keyword">public</span> <span class="title">Unsubscriber</span>(<span class="params">List&lt;IObserver&lt;Location&gt;&gt; observers, IObserver&lt;Location&gt; observer</span>)</span></span><br><span class="line"><span class="function"></span>        &#123;</span><br><span class="line">            <span class="keyword">this</span>._observers = observers;</span><br><span class="line">            <span class="keyword">this</span>._observer = observer;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">Dispose</span>(<span class="params"></span>)</span></span><br><span class="line"><span class="function"></span>        &#123;</span><br><span class="line">            <span class="keyword">if</span> (_observer != <span class="literal">null</span> &amp;&amp; _observers.Contains(_observer))</span><br><span class="line">                _observers.Remove(_observer);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">TrackLocation</span>(<span class="params">Nullable&lt;Location&gt; loc</span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        <span class="keyword">foreach</span> (<span class="keyword">var</span> observer <span class="keyword">in</span> observers) &#123;</span><br><span class="line">            <span class="keyword">if</span> (! loc.HasValue)</span><br><span class="line">                observer.OnError(<span class="keyword">new</span> LocationUnknownException());</span><br><span class="line">            <span class="keyword">else</span></span><br><span class="line">                observer.OnNext(loc.Value);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">EndTransmission</span>(<span class="params"></span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        <span class="keyword">foreach</span> (<span class="keyword">var</span> observer <span class="keyword">in</span> observers.ToArray())</span><br><span class="line">            <span class="keyword">if</span> (observers.Contains(observer))</span><br><span class="line">                observer.OnCompleted();</span><br><span class="line"></span><br><span class="line">        observers.Clear();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title">LocationUnknownException</span> : <span class="title">Exception</span></span><br><span class="line">&#123;</span><br><span class="line">    <span class="function"><span class="keyword">internal</span> <span class="title">LocationUnknownException</span>(<span class="params"></span>)</span></span><br><span class="line"><span class="function"></span>    &#123; &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">struct</span> Location</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">double</span> lat, lon;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="title">Location</span>(<span class="params"><span class="keyword">double</span> latitude, <span class="keyword">double</span> longitude</span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        <span class="keyword">this</span>.lat = latitude;</span><br><span class="line">        <span class="keyword">this</span>.lon = longitude;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">double</span> Latitude</span><br><span class="line">    &#123; <span class="keyword">get</span> &#123; <span class="keyword">return</span> <span class="keyword">this</span>.lat; &#125; &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">double</span> Longitude</span><br><span class="line">    &#123; <span class="keyword">get</span> &#123; <span class="keyword">return</span> <span class="keyword">this</span>.lon; &#125; &#125;</span><br><span class="line">&#125;</span><br><span class="line">public class LocationReporter : IObserver&lt;Location&gt;</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">private</span> IDisposable unsubscriber;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">string</span> instName;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="title">LocationReporter</span>(<span class="params"><span class="keyword">string</span> name</span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        <span class="keyword">this</span>.instName = name;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">string</span> Name</span><br><span class="line">    &#123;  <span class="keyword">get</span>&#123; <span class="keyword">return</span> <span class="keyword">this</span>.instName; &#125; &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">Subscribe</span>(<span class="params">IObservable&lt;Location&gt; provider</span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        <span class="keyword">if</span> (provider != <span class="literal">null</span>)</span><br><span class="line">            unsubscriber = provider.Subscribe(<span class="keyword">this</span>);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">OnCompleted</span>(<span class="params"></span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        Console.WriteLine(<span class="string">"The Location Tracker has completed transmitting data to &#123;0&#125;."</span>, <span class="keyword">this</span>.Name);</span><br><span class="line">        <span class="keyword">this</span>.Unsubscribe();</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">OnError</span>(<span class="params">Exception e</span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        Console.WriteLine(<span class="string">"&#123;0&#125;: The location cannot be determined."</span>, <span class="keyword">this</span>.Name);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">OnNext</span>(<span class="params">Location <span class="keyword">value</span></span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        Console.WriteLine(<span class="string">"&#123;2&#125;: The current location is &#123;0&#125;, &#123;1&#125;"</span>, <span class="keyword">value</span>.Latitude, <span class="keyword">value</span>.Longitude, <span class="keyword">this</span>.Name);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">Unsubscribe</span>(<span class="params"></span>)</span></span><br><span class="line"><span class="function"></span>    &#123;</span><br><span class="line">        unsubscriber.Dispose();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/06/08/dontworry/Unity3d/IObserver%E5%92%8CIObservable%E5%92%8CIDisposable/" data-id="ckb6hw6r6000rjcn24rgrhjtp" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/Unity3d/" rel="tag">Unity3d</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/杂项/javascript的本质" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/05/28/dontworry/%E6%9D%82%E9%A1%B9/javascript%E7%9A%84%E6%9C%AC%E8%B4%A8/" class="article-date">
  <time datetime="2020-05-27T16:01:17.000Z" itemprop="datePublished">2020-05-28</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/05/28/dontworry/%E6%9D%82%E9%A1%B9/javascript%E7%9A%84%E6%9C%AC%E8%B4%A8/">javascript的本质</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <ul>
<li>一个充满着函数且由原型链组成的对象的语言</li>
<li>有<code>this</code>绑定，<code>prototype</code>链</li>
<li>奇怪的作用域</li>
<li>函数调用组成的闭包，看起来像类，结果就让人们在此基础上，搞出像面向对象语言一样的类的各种用法。</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/05/28/dontworry/%E6%9D%82%E9%A1%B9/javascript%E7%9A%84%E6%9C%AC%E8%B4%A8/" data-id="ckb6hw6ru001ljcn22vdrfss2" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/%E6%9D%82%E9%A1%B9/" rel="tag">杂项</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/杂项/协程的原理" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/05/27/dontworry/%E6%9D%82%E9%A1%B9/%E5%8D%8F%E7%A8%8B%E7%9A%84%E5%8E%9F%E7%90%86/" class="article-date">
  <time datetime="2020-05-26T17:31:17.000Z" itemprop="datePublished">2020-05-27</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/05/27/dontworry/%E6%9D%82%E9%A1%B9/%E5%8D%8F%E7%A8%8B%E7%9A%84%E5%8E%9F%E7%90%86/">协程的原理</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="unity中的协程原理"><a href="#unity中的协程原理" class="headerlink" title="unity中的协程原理"></a>unity中的协程原理</h2><ul>
<li>使用的C#中的迭代器，几个关键 <code>IEnumerator</code>,<code>if(e.MoveNext())</code>,<code>e.Current</code>,每次<code>MoveNext()</code>都会执行<code>yield</code>之前的代码</li>
<li>在unity中会在每帧对<code>MoveNext()</code>进行判断，当符合条件的，就执行下次<code>MoveNext()</code>,同时返回<code>Current</code>.</li>
<li>在此过程中可以加入，很多的判断，比如网络，加载资源，延时操作等。</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/05/27/dontworry/%E6%9D%82%E9%A1%B9/%E5%8D%8F%E7%A8%8B%E7%9A%84%E5%8E%9F%E7%90%86/" data-id="ckb6hw6rz0021jcn213xwelq7" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/%E6%9D%82%E9%A1%B9/" rel="tag">杂项</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/杂项/linux下的nginx的基本操作" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/05/20/dontworry/%E6%9D%82%E9%A1%B9/linux%E4%B8%8B%E7%9A%84nginx%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C/" class="article-date">
  <time datetime="2020-05-20T07:18:24.921Z" itemprop="datePublished">2020-05-20</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/05/20/dontworry/%E6%9D%82%E9%A1%B9/linux%E4%B8%8B%E7%9A%84nginx%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C/">linux下的nginx的基本操作</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <ul>
<li>安装nginx</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># wget http://nginx.org/download/nginx-1.13.6.tar.gz</span></span><br><span class="line"><span class="comment"># tar -zvxf nginx-1.13.6.tar.gz</span></span><br><span class="line"><span class="comment"># apt-get install libpcre3 libpcre3-dev</span></span><br><span class="line"><span class="comment"># sudo apt-get install zlib1g-dev</span></span><br><span class="line"><span class="comment"># ./configure --prefix=/server/runtime/nginx/1.13.6</span></span><br><span class="line"><span class="comment"># make &amp;&amp; make install</span></span><br><span class="line"><span class="comment"># whereis nginx</span></span><br><span class="line"><span class="comment"># cd sbin</span></span><br><span class="line"><span class="comment"># ./nginx</span></span><br></pre></td></tr></table></figure>
<ul>
<li><p>prefix参数是自己设置的安装目标路径 <code>./configure --prefix=/server/runtime/nginx/1.12.2</code> </p>
</li>
<li><p>进入配置文件文件夹 <code>cd /usr/local/nginx/conf</code></p>
</li>
<li><p>备份配置文件（备份是个好习惯，可省略）<code>cp nginx.conf nginx.conf.bak</code></p>
</li>
<li><p>编辑nginx.conf配置文件 <code>vi nginx.conf</code></p>
</li>
<li><p>开启<code>./nginx</code></p>
</li>
<li><p>停止<code>./nginx -s stop</code></p>
</li>
<li><p>重新启动<code>./nginx -s reload</code></p>
</li>
<li><p>查询nginx进程<code>ps aux|grep nginx</code></p>
</li>
<li><p>先停止再启动（推荐）</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">./nginx -s quit</span><br><span class="line">./nginx</span><br></pre></td></tr></table></figure>
</li>
<li><p>当修改nginx.conf 修改，要想让配置生效需要重启nginx，使用./nginx -s reload不用先停止nginx再启动，即可将配置信息在nginx中生效。<br><code>./nginx -s reload</code></p>
</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/05/20/dontworry/%E6%9D%82%E9%A1%B9/linux%E4%B8%8B%E7%9A%84nginx%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C/" data-id="ckb6hw6ry001vjcn21zxxccda" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/%E6%9D%82%E9%A1%B9/" rel="tag">杂项</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/杂项/常用函数动词" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/05/15/dontworry/%E6%9D%82%E9%A1%B9/%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0%E5%8A%A8%E8%AF%8D/" class="article-date">
  <time datetime="2020-05-15T08:03:37.180Z" itemprop="datePublished">2020-05-15</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/05/15/dontworry/%E6%9D%82%E9%A1%B9/%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0%E5%8A%A8%E8%AF%8D/">常用函数动词</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <hr>
<table>
<thead>
<tr>
<th>动词</th>
<th>解释</th>
<th>反义词</th>
<th>解释</th>
</tr>
</thead>
<tbody><tr>
<td>get</td>
<td>获取</td>
<td>set</td>
<td>设置</td>
</tr>
<tr>
<td>add</td>
<td>增加</td>
<td>remove</td>
<td>删除</td>
</tr>
<tr>
<td>create</td>
<td>创建</td>
<td>destory</td>
<td>移除</td>
</tr>
<tr>
<td>start</td>
<td>启动</td>
<td>stop</td>
<td>停止</td>
</tr>
<tr>
<td>open</td>
<td>打开</td>
<td>close</td>
<td>关闭</td>
</tr>
<tr>
<td>read</td>
<td>读取</td>
<td>write</td>
<td>写入</td>
</tr>
<tr>
<td>load</td>
<td>载入</td>
<td>save</td>
<td>保存</td>
</tr>
<tr>
<td>create</td>
<td>创建</td>
<td>destroy</td>
<td>销毁</td>
</tr>
<tr>
<td>begin</td>
<td>开始</td>
<td>end</td>
<td>结束</td>
</tr>
<tr>
<td>backup</td>
<td>备份</td>
<td>restore</td>
<td>恢复</td>
</tr>
<tr>
<td>import</td>
<td>导入</td>
<td>export</td>
<td>导出</td>
</tr>
<tr>
<td>split</td>
<td>分割</td>
<td>merge</td>
<td>合并</td>
</tr>
<tr>
<td>inject</td>
<td>注入</td>
<td>extract</td>
<td>提取</td>
</tr>
<tr>
<td>attach</td>
<td>附着</td>
<td>detach</td>
<td>脱离</td>
</tr>
<tr>
<td>bind</td>
<td>绑定</td>
<td>separate</td>
<td>分离</td>
</tr>
<tr>
<td>view</td>
<td>查看</td>
<td>browse</td>
<td>浏览</td>
</tr>
<tr>
<td>edit</td>
<td>编辑</td>
<td>modify</td>
<td>修改</td>
</tr>
<tr>
<td>select</td>
<td>选取</td>
<td>mark</td>
<td>标记</td>
</tr>
<tr>
<td>copy</td>
<td>复制</td>
<td>paste</td>
<td>粘贴</td>
</tr>
<tr>
<td>undo</td>
<td>撤销</td>
<td>redo</td>
<td>重做</td>
</tr>
<tr>
<td>insert</td>
<td>插入</td>
<td>delete</td>
<td>移除</td>
</tr>
<tr>
<td>add</td>
<td>加入</td>
<td>append</td>
<td>添加</td>
</tr>
<tr>
<td>clean</td>
<td>清理</td>
<td>clear</td>
<td>清除</td>
</tr>
<tr>
<td>index</td>
<td>索引</td>
<td>sort</td>
<td>排序</td>
</tr>
<tr>
<td>find</td>
<td>查找</td>
<td>search</td>
<td>搜索</td>
</tr>
<tr>
<td>increase</td>
<td>增加</td>
<td>decrease</td>
<td>减少</td>
</tr>
<tr>
<td>play</td>
<td>播放</td>
<td>pause</td>
<td>暂停</td>
</tr>
<tr>
<td>launch</td>
<td>启动</td>
<td>run</td>
<td>运行</td>
</tr>
<tr>
<td>compile</td>
<td>编译</td>
<td>execute</td>
<td>执行</td>
</tr>
<tr>
<td>debug</td>
<td>调试</td>
<td>trace</td>
<td>跟踪</td>
</tr>
<tr>
<td>observe</td>
<td>观察</td>
<td>listen</td>
<td>监听</td>
</tr>
<tr>
<td>build</td>
<td>构建</td>
<td>publish</td>
<td>发布</td>
</tr>
<tr>
<td>input</td>
<td>输入</td>
<td>output</td>
<td>输出,</td>
</tr>
<tr>
<td>encode</td>
<td>编码</td>
<td>decode</td>
<td>解码</td>
</tr>
<tr>
<td>encrypt</td>
<td>加密</td>
<td>decrypt</td>
<td>解密</td>
</tr>
<tr>
<td>compress</td>
<td>压缩</td>
<td>decompress</td>
<td>解压缩</td>
</tr>
<tr>
<td>pack</td>
<td>打包</td>
<td>unpack</td>
<td>解包,</td>
</tr>
<tr>
<td>parse</td>
<td>解析</td>
<td>emit</td>
<td>生成</td>
</tr>
<tr>
<td>connect</td>
<td>连接</td>
<td>disconnect</td>
<td>断开</td>
</tr>
<tr>
<td>send</td>
<td>发送</td>
<td>receive</td>
<td>接收</td>
</tr>
<tr>
<td>download</td>
<td>下载</td>
<td>upload</td>
<td>上传</td>
</tr>
<tr>
<td>refresh</td>
<td>刷新</td>
<td>synchronize</td>
<td>同步</td>
</tr>
<tr>
<td>update</td>
<td>更新</td>
<td>revert</td>
<td>复原</td>
</tr>
<tr>
<td>lock</td>
<td>锁定</td>
<td>unlock</td>
<td>解锁</td>
</tr>
<tr>
<td>checkout</td>
<td>签出</td>
<td>checkin</td>
<td>签入</td>
</tr>
<tr>
<td>submit</td>
<td>提交</td>
<td>commit</td>
<td>交付</td>
</tr>
<tr>
<td>push</td>
<td>推</td>
<td>pull</td>
<td>拉,</td>
</tr>
<tr>
<td>expand</td>
<td>展开</td>
<td>collapse</td>
<td>折叠</td>
</tr>
<tr>
<td>begin</td>
<td>起始</td>
<td>end</td>
<td>结束,</td>
</tr>
<tr>
<td>start</td>
<td>开始</td>
<td>finish</td>
<td>完成</td>
</tr>
<tr>
<td>enter</td>
<td>进入</td>
<td>exit</td>
<td>退出</td>
</tr>
<tr>
<td>abort</td>
<td>放弃</td>
<td>quit</td>
<td>离开</td>
</tr>
<tr>
<td>obsolete</td>
<td>废弃</td>
<td>depreciate</td>
<td>废旧</td>
</tr>
<tr>
<td>collect</td>
<td>收集</td>
<td>aggregate</td>
<td>聚集</td>
</tr>
</tbody></table>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/05/15/dontworry/%E6%9D%82%E9%A1%B9/%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0%E5%8A%A8%E8%AF%8D/" data-id="ckb6hw6s00023jcn2f98fanzh" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/%E6%9D%82%E9%A1%B9/" rel="tag">杂项</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/随笔/不要从头开始" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/05/10/dontworry/%E9%9A%8F%E7%AC%94/%E4%B8%8D%E8%A6%81%E4%BB%8E%E5%A4%B4%E5%BC%80%E5%A7%8B/" class="article-date">
  <time datetime="2020-05-10T09:25:58.000Z" itemprop="datePublished">2020-05-10</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/05/10/dontworry/%E9%9A%8F%E7%AC%94/%E4%B8%8D%E8%A6%81%E4%BB%8E%E5%A4%B4%E5%BC%80%E5%A7%8B/">不要从头开始</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>看小说，看电视电影都喜欢从第一集开始看，因为好的小说电影总是会在开头介绍很多背景或者埋下一些伏笔。从头开始，可以收获最多的乐趣。不管小说电影都是娱乐产品，许多人都爱好，同样有些人却没什么兴趣。让一个人对某些东西产生兴趣是很复杂的，很多因素都会引起人的兴趣，同时会有一些让人厌恶的同样会让人丧失兴趣。读书，学习喜欢的人就少了很多，不过还是有很少的人对此乐在其中。学习和读书的兴趣如何培养呢？为何大多少人都不感冒呢。可能是两种传播形式的差异导致的。比如小说，电影其中有许多精彩的片段，这些片段单独给人看，其中的乐趣依然不会减少太多。这些片段就是让人入坑最好的名片。可是硬核的知识不是如此，比较有深度的知识，都是充斥着大量的脱离实际的概念，只有理解这些概念，才有资格去体会知识的魅力。而且单独的一段内容别说毫无乐趣可言，简直就如天书一般。这样对此热衷的人多才怪呢。但是还是有人热衷于此的对吧。他们又是为什么对这些晦涩的知识痴迷的呢？我认为，不管什么样的形式内容，每个人都会找到自己喜欢的，或者字面意思的喜欢。这就足够了。每个人看学习新知识的时候，不要想着打基础，读概念，这种方式不仅折磨人，还让人失去自己的创造力。我们直接跳过这些步骤，去看自己喜欢的内容，哪怕只要收获一丝丝的快乐。这种快乐就会推着你去追根溯源，快乐加倍。这样的学习方式才是最好的，最符合人性的。所以不管是书籍还是教学视频都应该最好自己的目录，让人从目录中去找自己喜欢的内容。学习者同样如此，不要去学那些抽象的概念，跳过去选择自己喜欢的内容，从喜欢的内容中找乐趣。这就是为啥说兴趣是最好老师的原因了。</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/05/10/dontworry/%E9%9A%8F%E7%AC%94/%E4%B8%8D%E8%A6%81%E4%BB%8E%E5%A4%B4%E5%BC%80%E5%A7%8B/" data-id="ckb6hw6s6002kjcn24zxpfe8y" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/%E9%9A%8F%E7%AC%94/" rel="tag">随笔</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/Unity3d/Gameframework的知识" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/05/07/dontworry/Unity3d/Gameframework%E7%9A%84%E7%9F%A5%E8%AF%86/" class="article-date">
  <time datetime="2020-05-07T07:04:01.820Z" itemprop="datePublished">2020-05-07</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/05/07/dontworry/Unity3d/Gameframework%E7%9A%84%E7%9F%A5%E8%AF%86/">Gameframework的知识</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <ul>
<li>fsm ，fsmState，procedure，通过有限状态机，对每个流程进行控制，每个流程就是个fsmState</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/05/07/dontworry/Unity3d/Gameframework%E7%9A%84%E7%9F%A5%E8%AF%86/" data-id="ckb6hw6r4000mjcn2flavca04" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/Unity3d/" rel="tag">Unity3d</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/Unity3d/unity和js相互调用" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/05/07/dontworry/Unity3d/unity%E5%92%8Cjs%E7%9B%B8%E4%BA%92%E8%B0%83%E7%94%A8/" class="article-date">
  <time datetime="2020-05-07T07:02:28.859Z" itemprop="datePublished">2020-05-07</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/05/07/dontworry/Unity3d/unity%E5%92%8Cjs%E7%9B%B8%E4%BA%92%E8%B0%83%E7%94%A8/">unity和js相互调用</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="js调用unity方法"><a href="#js调用unity方法" class="headerlink" title="js调用unity方法"></a>js调用unity方法</h2><p>主要在js端，如index.html中应该有如下代码</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> gameInstance = UnityLoader.instantiate(<span class="string">"gameContainer"</span>, <span class="string">"Build/Builds.json"</span>, &#123;<span class="attr">onProgress</span>: UnityProgress&#125;);</span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">jsCallUnity</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">    gameInstance.SendMessage(<span class="string">"Main Camera"</span>, <span class="string">"JsCallUnity"</span>);<span class="comment">// 注意Main Carera是脚本挂载的GameObject的名称，JsCallUnity是脚本的方法名。</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="unity-调用js方法"><a href="#unity-调用js方法" class="headerlink" title="unity 调用js方法"></a>unity 调用js方法</h2><p>1、在Assets/Plugins/下新建一个<code>__Internalplugins.jslib</code>文件，其中代码如下：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">mergeInto(LibraryManager.library, &#123;</span><br><span class="line"></span><br><span class="line">  UnityCallJs: <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">    fromUnity(<span class="string">"Hello, world!"</span>);</span><br><span class="line">  &#125;,</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>
<p>2、在C#代码中使用</p>
<figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[<span class="meta">DllImport(<span class="meta-string">"__Internal"</span>)</span>]</span><br><span class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">extern</span> <span class="keyword">void</span> <span class="title">UnityCallJs</span>(<span class="params"></span>)</span>;</span><br></pre></td></tr></table></figure>
<p>3、js中的方法声明</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">fromUnity</span>(<span class="params">s</span>)</span>&#123;</span><br><span class="line">    alert(s);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/05/07/dontworry/Unity3d/unity%E5%92%8Cjs%E7%9B%B8%E4%BA%92%E8%B0%83%E7%94%A8/" data-id="ckb6hw6r90013jcn2hgbdg81b" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/Unity3d/" rel="tag">Unity3d</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/申论/中华民族传统文化的继承与弘扬的启示" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/05/07/dontworry/%E7%94%B3%E8%AE%BA/%E4%B8%AD%E5%8D%8E%E6%B0%91%E6%97%8F%E4%BC%A0%E7%BB%9F%E6%96%87%E5%8C%96%E7%9A%84%E7%BB%A7%E6%89%BF%E4%B8%8E%E5%BC%98%E6%89%AC%E7%9A%84%E5%90%AF%E7%A4%BA/" class="article-date">
  <time datetime="2020-05-06T16:55:58.000Z" itemprop="datePublished">2020-05-07</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/05/07/dontworry/%E7%94%B3%E8%AE%BA/%E4%B8%AD%E5%8D%8E%E6%B0%91%E6%97%8F%E4%BC%A0%E7%BB%9F%E6%96%87%E5%8C%96%E7%9A%84%E7%BB%A7%E6%89%BF%E4%B8%8E%E5%BC%98%E6%89%AC%E7%9A%84%E5%90%AF%E7%A4%BA/">中华民族传统文化的继承与弘扬的启示</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="如何做好基层文化建设工作，直接关系到中华民族传统文化的继承与弘扬，请你谈谈“给定资料1～3”对做好这方面工作有哪些启示。"><a href="#如何做好基层文化建设工作，直接关系到中华民族传统文化的继承与弘扬，请你谈谈“给定资料1～3”对做好这方面工作有哪些启示。" class="headerlink" title="如何做好基层文化建设工作，直接关系到中华民族传统文化的继承与弘扬，请你谈谈“给定资料1～3”对做好这方面工作有哪些启示。"></a>如何做好基层文化建设工作，直接关系到中华民族传统文化的继承与弘扬，请你谈谈“给定资料1～3”对做好这方面工作有哪些启示。</h2><p>1、</p>
<h2 id="根据“给定资料4～6”，请你概括目前汉语生态环境面临的主要问题。"><a href="#根据“给定资料4～6”，请你概括目前汉语生态环境面临的主要问题。" class="headerlink" title="根据“给定资料4～6”，请你概括目前汉语生态环境面临的主要问题。"></a>根据“给定资料4～6”，请你概括目前汉语生态环境面临的主要问题。</h2><ul>
<li>父母对汉语的重视程度不如英语，引导孩子在英语学习上投入大量的时间和金钱。</li>
<li>我国对汉语生态环境的保护力度不够，没有很好的维护民族语言的安全。</li>
<li>西方大众文化通过外来语对汉语文化生态产生了污染。</li>
<li>汉语在一些社会活动中被边缘化。</li>
<li>年轻人对汉古典文化资源的舍弃和漠视现象随处可见。<h2 id="根据“给定资料7”，指出法国在保护本国文化方面有哪些做法值得借鉴。"><a href="#根据“给定资料7”，指出法国在保护本国文化方面有哪些做法值得借鉴。" class="headerlink" title="根据“给定资料7”，指出法国在保护本国文化方面有哪些做法值得借鉴。"></a>根据“给定资料7”，指出法国在保护本国文化方面有哪些做法值得借鉴。</h2></li>
<li>发布了文化例外的主张，阻止外国文化在本国自由流通。</li>
<li>限制在法语中使用外来语。</li>
<li>对电台和电视中法语节目进行保护。</li>
<li>增强本土文化的竞争力，扶持本国文化事业的发展。</li>
<li>向其他国家推介本国文化。</li>
<li>鼓励企业和各类协会向外国宣传法国文化。</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/05/07/dontworry/%E7%94%B3%E8%AE%BA/%E4%B8%AD%E5%8D%8E%E6%B0%91%E6%97%8F%E4%BC%A0%E7%BB%9F%E6%96%87%E5%8C%96%E7%9A%84%E7%BB%A7%E6%89%BF%E4%B8%8E%E5%BC%98%E6%89%AC%E7%9A%84%E5%90%AF%E7%A4%BA/" data-id="ckb6hw6s6002ljcn28g8wdo8n" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/%E7%94%B3%E8%AE%BA/" rel="tag">申论</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="ejs-dontworry/Algorithm/二叉树的下一个节点" class="article article-type-ejs" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/guolianbo/2020/04/30/dontworry/Algorithm/%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E4%B8%8B%E4%B8%80%E4%B8%AA%E8%8A%82%E7%82%B9/" class="article-date">
  <time datetime="2020-04-30T07:22:48.041Z" itemprop="datePublished">2020-04-30</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/guolianbo/2020/04/30/dontworry/Algorithm/%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E4%B8%8B%E4%B8%80%E4%B8%AA%E8%8A%82%E7%82%B9/">二叉树的下一个节点</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="介绍"><a href="#介绍" class="headerlink" title="介绍"></a>介绍</h2><p>给定一个二叉树和其中的一个结点，请找出中序遍历顺序的下一个结点并且返回。注意，树中的结点不仅包含左右子结点，同时包含指向父结点的指针。</p>
<h2 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h2><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> tree0 = <span class="keyword">new</span> TreeNode(<span class="number">0</span>);</span><br><span class="line"><span class="keyword">const</span> tree1 = <span class="keyword">new</span> TreeNode(<span class="number">1</span>);</span><br><span class="line"><span class="keyword">const</span> tree2 = <span class="keyword">new</span> TreeNode(<span class="number">2</span>);</span><br><span class="line"><span class="keyword">const</span> tree3 = <span class="keyword">new</span> TreeNode(<span class="number">3</span>);</span><br><span class="line"><span class="keyword">const</span> tree4 = <span class="keyword">new</span> TreeNode(<span class="number">4</span>);</span><br><span class="line"><span class="keyword">const</span> tree5 = <span class="keyword">new</span> TreeNode(<span class="number">5</span>);</span><br><span class="line"><span class="keyword">const</span> tree6 = <span class="keyword">new</span> TreeNode(<span class="number">6</span>);</span><br><span class="line"></span><br><span class="line">tree0.left = tree1;</span><br><span class="line">tree0.right = tree2;</span><br><span class="line">tree1.next = tree0;</span><br><span class="line">tree2.next = tree0;</span><br><span class="line">tree1.left = tree3;</span><br><span class="line">tree3.next = tree1;</span><br><span class="line">tree4.next = tree3;</span><br><span class="line">tree3.right = tree4;</span><br><span class="line">tree2.right = tree5;</span><br><span class="line">tree5.next = tree2;</span><br><span class="line">tree5.right = tree6;</span><br><span class="line">tree6.next = tree5;</span><br><span class="line"></span><br><span class="line"><span class="built_in">console</span>.log(GetNext(tree6));</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">TreeNode</span>(<span class="params">x</span>) </span>&#123;</span><br><span class="line">  <span class="keyword">this</span>.val = x;</span><br><span class="line">  <span class="keyword">this</span>.left = <span class="literal">null</span>;</span><br><span class="line">  <span class="keyword">this</span>.right = <span class="literal">null</span>;</span><br><span class="line">  <span class="keyword">this</span>.next = <span class="literal">null</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">GetNext</span>(<span class="params">pNode</span>) </span>&#123;</span><br><span class="line">  <span class="keyword">if</span> (!pNode) <span class="keyword">return</span> <span class="literal">null</span>;</span><br><span class="line">  <span class="keyword">let</span> node = pNode;</span><br><span class="line">  <span class="keyword">if</span> (node.right) &#123;</span><br><span class="line">    node = node.right;</span><br><span class="line">    <span class="keyword">while</span> (node.left) &#123;</span><br><span class="line">      node = node.left;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> node;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="keyword">while</span> (node.next) &#123;</span><br><span class="line">    <span class="keyword">if</span> (node.next.left === node) <span class="keyword">return</span> node.next;</span><br><span class="line">    node = node.next;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="keyword">return</span> <span class="literal">null</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>深入理解中序排序的逻辑</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://dontworryneedmoney.gitee.io/guolianbo/2020/04/30/dontworry/Algorithm/%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E4%B8%8B%E4%B8%80%E4%B8%AA%E8%8A%82%E7%82%B9/" data-id="ckb6hw6qx0003jcn22yuq5mqz" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/guolianbo/tags/Algorithm/" rel="tag">Algorithm</a></li></ul>

    </footer>
  </div>
  
</article>


  


  <nav id="page-nav">
    
    <span class="page-number current">1</span><a class="page-number" href="/guolianbo/page/2/">2</a><a class="page-number" href="/guolianbo/page/3/">3</a><span class="space">&hellip;</span><a class="page-number" href="/guolianbo/page/9/">9</a><a class="extend next" rel="next" href="/guolianbo/page/2/">Next &amp;raquo;</a>
  </nav>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/guolianbo/categories/%E9%9A%8F%E7%AC%94/">随笔</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/guolianbo/tags/Algorithm/" rel="tag">Algorithm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/guolianbo/tags/Unity3d/" rel="tag">Unity3d</a></li><li class="tag-list-item"><a class="tag-list-link" href="/guolianbo/tags/%E6%9D%82%E9%A1%B9/" rel="tag">杂项</a></li><li class="tag-list-item"><a class="tag-list-link" href="/guolianbo/tags/%E6%B6%88%E9%98%B2/" rel="tag">消防</a></li><li class="tag-list-item"><a class="tag-list-link" href="/guolianbo/tags/%E7%94%B3%E8%AE%BA/" rel="tag">申论</a></li><li class="tag-list-item"><a class="tag-list-link" href="/guolianbo/tags/%E9%9A%8F%E7%AC%94/" rel="tag">随笔</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/guolianbo/tags/Algorithm/" style="font-size: 14px;">Algorithm</a> <a href="/guolianbo/tags/Unity3d/" style="font-size: 12px;">Unity3d</a> <a href="/guolianbo/tags/%E6%9D%82%E9%A1%B9/" style="font-size: 18px;">杂项</a> <a href="/guolianbo/tags/%E6%B6%88%E9%98%B2/" style="font-size: 16px;">消防</a> <a href="/guolianbo/tags/%E7%94%B3%E8%AE%BA/" style="font-size: 10px;">申论</a> <a href="/guolianbo/tags/%E9%9A%8F%E7%AC%94/" style="font-size: 20px;">随笔</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2020/06/">June 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2020/05/">May 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2020/04/">April 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2020/03/">March 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2020/02/">February 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2020/01/">January 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2019/11/">November 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2019/09/">September 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2019/07/">July 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/guolianbo/archives/2019/06/">June 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/guolianbo/2020/06/08/dontworry/Unity3d/IObserver%E5%92%8CIObservable%E5%92%8CIDisposable/">IObserver和IObservable和IDisposable</a>
          </li>
        
          <li>
            <a href="/guolianbo/2020/05/28/dontworry/%E6%9D%82%E9%A1%B9/javascript%E7%9A%84%E6%9C%AC%E8%B4%A8/">javascript的本质</a>
          </li>
        
          <li>
            <a href="/guolianbo/2020/05/27/dontworry/%E6%9D%82%E9%A1%B9/%E5%8D%8F%E7%A8%8B%E7%9A%84%E5%8E%9F%E7%90%86/">协程的原理</a>
          </li>
        
          <li>
            <a href="/guolianbo/2020/05/20/dontworry/%E6%9D%82%E9%A1%B9/linux%E4%B8%8B%E7%9A%84nginx%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C/">linux下的nginx的基本操作</a>
          </li>
        
          <li>
            <a href="/guolianbo/2020/05/15/dontworry/%E6%9D%82%E9%A1%B9/%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0%E5%8A%A8%E8%AF%8D/">常用函数动词</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 worry dont<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/guolianbo/" class="mobile-nav-link">Home</a>
  
    <a href="/guolianbo/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  
<link rel="stylesheet" href="/guolianbo/fancybox/jquery.fancybox.css">

  
<script src="/guolianbo/fancybox/jquery.fancybox.pack.js"></script>




<script src="/guolianbo/js/script.js"></script>




  </div>
</body>
</html>